package wsz.front.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import wsz.edu.dto.PromotionSpaceDTO;
import wsz.edu.remote.AdRemoteService;
import wsz.edu.response.ResponseDTO;

import java.util.List;

/**
 * 广告相关
 * @author wsz
 * @date 2022/4/25 15:40
 **/
@RestController
@RequestMapping("/ad")
public class AdController {

    @Autowired
    private AdRemoteService adRemoteService;

    @GetMapping("/getAdBySpaceKey")
    public ResponseDTO getAdBySpaceKey(@RequestParam("spaceKey") String[] spaceKey) {
        List<PromotionSpaceDTO> adBySpaceKey = adRemoteService.getAdBySpaceKey(spaceKey);
        return ResponseDTO.success(adBySpaceKey);
    }
}
